package com.test;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * Created by 41579 on 2017/4/21.
 */
public class CountDownLatchRunnable implements Runnable {
    private CountDownLatch coutDown;

    public CountDownLatchRunnable(CountDownLatch coutDown) {
        this.coutDown = coutDown;
    }

    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(3);
            System.out.println(Thread.currentThread().getName()+"  execute....");
            coutDown.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
